<?php

import("data.db.property.DbUnitProperty");

class UnitProperty extends DbUnitProperty {
	
	function UnitProperty() {
		parent::DbUnitProperty();
	}
	
	function getComparator_DisplayNameAsc() {
		return create_function('$a, $b', '
			if ($a->getDisplayName() == $b->getDisplayName()) {
        		return 0;
    		}
    		return ($a->getDisplayName() < $b->getDisplayName()) ? -1 : 1;
    	');
	}
	
	function getExplanationPath() {
		return SITE_PATH."resources/ru/explain/".$this->getId()."/";
	}
	
	function hasExplanation() {
		$explain_path = $this->getExplanationPath();
		return (file_exists($explain_path."index.html")?true:false);
	}
	
	function getExplanationId() {
		return $this->getId();
	}
	
}
?>